/*
 * Copyright (c) 2014, Asiainfo-Linkage. All rights reserved.
 * Asiainfo-Linkage PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package edu.w106.platform.scheduler;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * <p><b>标题：</b>AbsJob.</p>
 *
 * <p><b>描述：</b></p>
 *
 * <p><b>版权：</b>Copyright (c) 2014 亚信联创</p>
 *
 * <p><b>工程：</b>w106-mc</p>
 *
 * @author w106
 *
 * @version 1.0.0
 *
 * @since 2014-5-4 下午1:34:52
 */
public abstract class AbsJob implements Job {

    protected String name;

    /* (non-Javadoc)
     * @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
     */
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        String config = context.getJobDetail().getJobDataMap().getString("config");
        name = context.getJobDetail().getJobDataMap().getString("name");
        executeJob(config);
    }

    protected abstract void executeJob(String config);
}
